'use strict'

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
    const { router, controller, io } = app
    router.get('/', controller.home.index)
    router.get('/news/:id', controller.home.news)
    router.get('/content', controller.home.content)
    router.get('/admin', controller.admin.index)
    router.get('/user', controller.home.user)
    router.get('/foo', controller.home.foo)
    router.post('/add', controller.home.add)
    router.get('/setCookie', controller.home.setCookie)
    router.get('/getCookie', controller.home.getCookie)
    router.get('/setSession', controller.home.setSession)
    router.get('/getSession', controller.home.getSession)
    router.get('/getId', controller.home.getId)
    router.get('/creat', controller.home.creat)

    // // 这里的sendMsg相当于一个接口， 负责处理客户端发送的sendMsg事件
    // // 这个controller是io模块的controller， 和egg的controller不同
    io.of('/').route('chat', io.controller.chat.ping)
}
